package com.zjwd.basic.service.impl;

import java.util.List;
import com.zjwd.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjwd.basic.mapper.BasicReportMapper;
import com.zjwd.basic.domain.BasicReport;
import com.zjwd.basic.service.IBasicReportService;

/**
 * 基础通用报Service业务层处理
 * 
 * @author liquan
 * @date 2025-10-11
 */
@Service
public class BasicReportServiceImpl implements IBasicReportService {

    @Autowired
    private BasicReportMapper mapper;

    /**
     * 根据主键ID查询详情
     *
     * @param id 基础通用报主键
     * @return 基础通用报
     */
    @Override
    public BasicReport getModelById(Integer id) {
        return mapper.getModelById(id);
    }

    /**
     * 查询列表
     *
     * @param model 基础通用报
     * @return 基础通用报
     */
    @Override
    public List<BasicReport> selectModelList(BasicReport model) {
        return mapper.selectModelList(model);
    }

    /**
     * 新增
     *
     * @param model 基础通用报
     * @return 结果
     */
    @Override
    public int insert(BasicReport model) {
        model.setCreateTime(DateUtils.getNowDate());
        return mapper.insert(model);
    }

    /**
     * 修改
     *
     * @param model 基础通用报
     * @return 结果
     */
    @Override
    public int update(BasicReport model) {
                model.setUpdateTime(DateUtils.getNowDate());
        return mapper.update(model);
    }

    /**
     * 批量删除
     *
     * @param ids 主键集合
     * @return 结果
     */
    @Override
    public int deleteByIds(Integer[] ids) {
        return mapper.deleteByIds(ids);
    }

    /**
     * 删除
     *
     * @param id 基础通用报主键
     * @return 结果
     */
    @Override
    public int delete(Integer id) {
        return mapper.delete(id);
    }
}
